package com.leyou.gateway.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/hystrix")
public class FallBackController {

    @RequestMapping("/fallback")
    public ResponseEntity<Map>  fallBack(){
        HashMap<Object, Object> hashMap = new HashMap<>();
        hashMap.put("code","502");
        hashMap.put("msg","服务超时");
        return ResponseEntity.status(502).body(hashMap);
    }
}
